package com.example.blog.service;

import com.example.blog.mapper.BlogInfoMapper;
import com.example.blog.model.BlogInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Home-pc
 * Date:0 2024-02-26
 * Time: 14:53
 */
@Service
public class BlogService {

    @Autowired
    private BlogInfoMapper blogInfoMapper;

    public List<BlogInfo> getBlogList(){
        return blogInfoMapper.queryBlogList();
    }

    public BlogInfo getBlogDetail(Integer id){
        return blogInfoMapper.queryById(id);
    }

    public Integer insertBlog(BlogInfo blogInfo) {
        return blogInfoMapper.insertBlog(blogInfo);
    }

    public Integer updateBlog(BlogInfo blogInfo) {
        return blogInfoMapper.updateBlog(blogInfo);
    }
}
